this.name = "rmb-chaff-setup-script.js";
this.author = "Ramirez";
this.copyright = "January 2009";
this.description = "Script to reload the chaff launcher";
this.version = "1.0";




this.shipLaunchedFromStation = function()

{
	if (player.ship.hasEquipment("EQ_RMB_CHAFF_LAUNCHER"))

		
		{		
			if(missionVariables.rmb_chaff_count == undefined) // after the purchase of the chaff launcher, set the chaff count to 5 and award a mine for free
			
				{
					missionVariables.rmb_chaff_count = 5
					missionVariables.rmb_chaff_loaded = "YES"
					player.ship.awardEquipment("EQ_RMB_CHAFF_MINE")
					player.consoleMessage(expandDescription("Chaff loaded.  You have " + [missionVariables.rmb_chaff_count] + " bundles available."), 6)
				}
				
			if(missionVariables.rmb_chaff_count == 0) // reset the chaff count for players who have used up 5 bundles - they still need to buy the mine to use them
				
				{
					missionVariables.rmb_chaff_count = 5
					missionVariables.rmb_chaff_loaded = "YES"
				
				}
				
			
			
				
			
				
			
		
		}
		
		}

